using spread operator to convert array into objects